package cn.Service.Impl;

import cn.Mapper.AdminMapper;
import cn.Service.AdminService;
import cn.entity.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AdminServiceImpl implements AdminService {

    @Autowired
    private AdminMapper adminMapper;

    public Admin getAdmin(Admin admin) {
        return adminMapper.getAdmin(admin);
    }


    public int updateAdmin(Admin admin) {
        return adminMapper.updateAdmin(admin);
    }


    public List<User> userAlllist() {
        return adminMapper.userAlllist();
    }


    public List<User> selectUserBywz(User user) {
        return adminMapper.selectUserBywz(user);
    }


    public List<Comment> selectCommentAll() {
        return adminMapper.selectCommentAll();
    }


    public List<Order> selectOrderAll() {
        return adminMapper.selectOrderAll();
    }


    public List<Order> selectOrderBywz(Order order) {
        return adminMapper.selectOrderBywz(order);
    }


    public Order selectOrderByoid(int oid) {
        return adminMapper.selectOrderByoid(oid);
    }


    public List<OrderItem> selectListOrder_itemByorder_id(int order_id) {
        return adminMapper.selectListOrder_itemByorder_id(order_id);
    }


    public void updateOrder_itemSend_countByid(int send_count,String id) {
        adminMapper.updateOrder_itemSend_countByid(send_count,id);
    }


    public void updateOrderByoid(String ostate, int oid) {
        adminMapper.updateOrderByoid(ostate,oid);
    }



    public void updateOrder_itemByOrder_id(int send_count, int Order_id) {
        adminMapper.updateOrder_itemByOrder_id(send_count,Order_id);
    }


    public void UpdateOrder(int oid, String ostate) {
        adminMapper.UpdateOrder(oid,ostate);

    }


    public List<OrderDetails> selectOrderDetails(int oid) {
        return adminMapper.selectOrderDetails(oid);
    }


    public Order selectOrderByonum(String oum) {
        return adminMapper.selectOrderByonum(oum);
    }


    public List<ShowPingLun> selectShowPingLunBypid(int pid) {
        return adminMapper.selectShowPingLunBypid(pid);
    }



    public List<Product> getProduct() {
        return adminMapper.getProduct();
    }


    public List<Product> getselectProduct(Integer pid) {
        return adminMapper.getselectProduct(pid);
    }


    public List<Product> getselectProductByname(String pname) {
        return adminMapper.getselectProductByname(pname);
    }


    public List<Product> getselectProductBypmaterial(String pmaterial) {
        return adminMapper.getselectProductBypmaterial(pmaterial);
    }


    public int updateProduct(Product product) {
        return adminMapper.updateProduct(product);
    }


    public int deleteProduct(Integer pid) {
        return adminMapper.deleteProduct(pid);
    }


    public int addProduct(Product product) {
        return adminMapper.addProduct(product);
    }


    public List<Product_bill> getProduct_bill() {
        return adminMapper.getProduct_bill();
    }


    public int updateProduct_bill(Product_bill product_bill) {
        return adminMapper.updateProduct_bill(product_bill);
    }


    public int addProduct_bill(Product_bill product_bill) {
        return adminMapper.addProduct_bill(product_bill);
    }


    public int deleteProduct_bill(String id) {
        return adminMapper.deleteProduct_bill(id);
    }


    public Product getProductById(Integer pid) {
        return adminMapper.getProductById(pid);
    }


    public List<OrderItem> getOrder_itemByPid(Integer pid) {
        return adminMapper.getOrder_itemByPid(pid);
    }


    public List<Order> getOrderByoid(Integer oid) {
        return adminMapper.getOrderByoid(oid);
    }


    public void updateProductNumByPid(int num, int pid) {
        adminMapper.updateProductNumByPid(num,pid);
    }



    public Category selectCategoryCnameByCname(String cname) {
        return adminMapper.selectCategoryCnameByCname(cname);
    }


    public void insertCategory(String cname) {
        adminMapper.insertCategory(cname);
    }


    public List<Category> selecttb_categoryAll() {
        return adminMapper.selecttb_categoryAll();
    }


    public List<Product> getProductListByCid(int cid) {
        return adminMapper.getProductListByCid(cid);
    }


    public void deleteCategoryBycid(int cid) {
        adminMapper.deleteCategoryBycid(cid);
    }







    public int deleteComment(int pid) {
        return adminMapper.deleteComment(pid);
    }

    public void updateUserStop(int stop, int uid) {
        adminMapper.updateUserStop(stop, uid);
    }

    public List<Product> selectProductByNum(int num) {
        return adminMapper.selectProductByNum(num);
    }

    public List<Product> selectProductByCid(String cname) {
        return adminMapper.selectProductByCid(cname);
    }


}
